<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var money = 100;
        var key = true;
        do {
            var num = prompt('请输入你想要的操作：\n1.存钱\n2.取钱\n3.显示余额\n4.退出');
            switch (parseInt(num)) {
                case 1:
                   var add = prompt('输入存的钱数');
                   money += parseInt(add);
                   break;
                case 2:
                   var subtract = prompt('输入取的钱数');
                   money -= parseInt(subtract);
                   break;
                case 3:
                   alert('你的余额是：' + money) 
                   break;
                case 4:
                   alert('你正在退出'); 
                   var key = false; 
                   break;
            }
        } while (key)
    </script>
</head>

<body>

</body>

</html>